-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aggregate #97
Aggregate #97
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comments
portfolyo/tools/duration.py
Outdated
@@ -14,7 +14,7 @@ def stamp(ts: pd.Timestamp, freq: str) -> tools_unit.Q_: | |||
---------- | |||
ts : pd.Timestamp | |||
Timestamp for which to calculate the duration. | |||
freq : {{{', '.join(tools_freq.FREQUENCIES)}}} | |||
freq : {{{tools_freq.ALLOWED_FREQUENCIES_DOCS}}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we only need single (not tripple) braces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
portfolyo/tools/freq.py
Outdated
# assert_freq_valid(freq_source) | ||
# assert_freq_valid(freq_target) | ||
# Compare if the freq are the same | ||
if freq_source == freq_target: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check after conversion to offset? (In case e.g. freqs are "QS" and "QS-JAN")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, also added case-test in tests
portfolyo/tools/freq.py
Outdated
) | ||
|
||
|
||
def up_or_down2(freq_source: str, freq_target: str) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we no longer have up_or_down
, maybe we can rename this back to up_or_down
? And move it down in the file, so assert_sufficiently_long
is next to assert_sufficiently_short
and assert_equally_long
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
portfolyo/tools/freq.py
Outdated
# we are in the case QS and QS | ||
return 0 | ||
|
||
raise ValueError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a descriptive message raised with with error, so the user knows what he did wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Aggregation to non-calendar periods #57
Added freq "QS-FEB","QS-MAR", etc, "AS-FEB", "AS-MAR" as allowed.
Defined aggregation rules between them
📚 Documentation preview 📚: https://portfolyo--97.org.readthedocs.build/en/97/